package org.nanotek.web;

import java.util.Set;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.NoneScoped;
import javax.inject.Inject;

import org.nanotek.beans.Release;
import org.nanotek.service.ReleaseService;

@SuppressWarnings("serial")
@ManagedBean(name="releaseBean")
@NoneScoped
public class ReleaseBean extends WebBean<Release>{

	@EJB 
	ReleaseService releaseService; 
	
	private Set<Release> releases;

	private String artistCredits; 

	@Inject private Release release; 
	
	public ReleaseBean() {
	}

	
	public void findReleases()
	{ 
		releases = releaseService.findReleases(artistCredits);
		System.out.println(artistCredits !=null? artistCredits : "");
	}
	
	public Set<Release> getReleases() {
		return releases;
	}

	public void setReleases(Set<Release> releases) {
		this.releases = releases;
	}

	public String getArtistCredits() {
		return artistCredits;
	}


	public void setArtistCredits(String  artistCredits) {
		this.artistCredits = artistCredits;
	}

	@Override
	public Release get() {
		return release;
	}


	public Release getRelease() {
		return release;
	}


	public void setRelease(Release release) {
		this.release = release;
	}
	
}
